package com.winsdom.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.winsdom.dto.CustomerBillingHeaderDTO;
import com.winsdom.entity.CustomerBillingHeader;
import com.winsdom.entity.vo.CustomerBillingHeaderVo;
import com.winsdom.vo.CustomerBillingHeaderQueryVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 * 客户开票抬头表 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2025-05-12
 */
@Mapper
public interface CustomerBillingHeaderMapper extends BaseMapper<CustomerBillingHeader> {
    IPage<CustomerBillingHeaderVo> headerPageList(Page<CustomerBillingHeaderVo> page, @Param("customerBillingHeaderDTO") CustomerBillingHeaderDTO customerBillingHeaderDTO);

    IPage<CustomerBillingHeaderVo> header1(Page<CustomerBillingHeaderVo> page, @Param("customerBillingHeaderDTO") CustomerBillingHeaderDTO customerBillingHeaderDTO);

    void updateAuditResult(CustomerBillingHeaderDTO dto);
    void updateAuditStatus(CustomerBillingHeaderDTO dto);

    /**
     * 根据客户ID查询发票抬头信息列表
     * @param customerId 客户ID
     * @return 发票抬头信息列表
     */
    List<CustomerBillingHeaderQueryVO> selectHeadersByCustomerId(Long customerId);

    String selectBuyerNameByCustomerName(String payerName);

    /**
     * 根据付款人和付款业主查到付款人id
     * @param payerCustomerName
     * @param payerName
     * @return
     */
    Long getCustomerIdByBuyerNameAndCustomerName(String payerCustomerName, String payerName);
}
